def OldToDict(old):
    dic = {}
    dic['id'] = old.ID
    dic['name'] = old.username
    dic['age'] = old.age
    dic['gender'] = old.gender
    dic['mobile'] = old.phone
    dic['date'] = str(old.checkin_date)
    dic['status'] = int(old.REMOVE)
    dic['description'] = old.DESCRIPTION
    dic['address'] = old.room_number
    dic['health'] = old.health_state
    return dic

def dictToOldDic(data):
    oldDic = {}
    oldDic['ID'] = data['id']
    oldDic['username'] = data['name']
    oldDic['age'] = data['age']
    oldDic['gender'] = data['gender']
    oldDic['phone']  = data['mobile']
    oldDic['REMOVE'] = data['status']
    oldDic['room_number'] = data['address']
    oldDic['DESCRIPTION'] = data['description']
    oldDic['health_state'] = data['health']
    return oldDic
